/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.targeter.rulesengine.service.persistence;

import com.liferay.portal.service.persistence.BasePersistence;

import com.targeter.rulesengine.model.models;

/**
 * The persistence interface for the models service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author jsalaice
 * @see modelsPersistenceImpl
 * @see modelsUtil
 * @generated
 */
public interface modelsPersistence extends BasePersistence<models> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link modelsUtil} to access the models persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the models in the entity cache if it is enabled.
	*
	* @param models the models
	*/
	public void cacheResult(com.targeter.rulesengine.model.models models);

	/**
	* Caches the modelses in the entity cache if it is enabled.
	*
	* @param modelses the modelses
	*/
	public void cacheResult(
		java.util.List<com.targeter.rulesengine.model.models> modelses);

	/**
	* Creates a new models with the primary key. Does not add the models to the database.
	*
	* @param _id the primary key for the new models
	* @return the new models
	*/
	public com.targeter.rulesengine.model.models create(long _id);

	/**
	* Removes the models with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param _id the primary key of the models
	* @return the models that was removed
	* @throws com.targeter.rulesengine.NoSuchmodelsException if a models with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models remove(long _id)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchmodelsException;

	public com.targeter.rulesengine.model.models updateImpl(
		com.targeter.rulesengine.model.models models, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the models with the primary key or throws a {@link com.targeter.rulesengine.NoSuchmodelsException} if it could not be found.
	*
	* @param _id the primary key of the models
	* @return the models
	* @throws com.targeter.rulesengine.NoSuchmodelsException if a models with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models findByPrimaryKey(long _id)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchmodelsException;

	/**
	* Returns the models with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param _id the primary key of the models
	* @return the models, or <code>null</code> if a models with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models fetchByPrimaryKey(long _id)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the modelses where model = &#63;.
	*
	* @param model the model
	* @return the matching modelses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.models> findBymodel(
		java.lang.String model)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the modelses where model = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param model the model
	* @param start the lower bound of the range of modelses
	* @param end the upper bound of the range of modelses (not inclusive)
	* @return the range of matching modelses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.models> findBymodel(
		java.lang.String model, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the modelses where model = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param model the model
	* @param start the lower bound of the range of modelses
	* @param end the upper bound of the range of modelses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching modelses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.models> findBymodel(
		java.lang.String model, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first models in the ordered set where model = &#63;.
	*
	* @param model the model
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching models
	* @throws com.targeter.rulesengine.NoSuchmodelsException if a matching models could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models findBymodel_First(
		java.lang.String model,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchmodelsException;

	/**
	* Returns the first models in the ordered set where model = &#63;.
	*
	* @param model the model
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching models, or <code>null</code> if a matching models could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models fetchBymodel_First(
		java.lang.String model,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last models in the ordered set where model = &#63;.
	*
	* @param model the model
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching models
	* @throws com.targeter.rulesengine.NoSuchmodelsException if a matching models could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models findBymodel_Last(
		java.lang.String model,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchmodelsException;

	/**
	* Returns the last models in the ordered set where model = &#63;.
	*
	* @param model the model
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching models, or <code>null</code> if a matching models could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models fetchBymodel_Last(
		java.lang.String model,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the modelses before and after the current models in the ordered set where model = &#63;.
	*
	* @param _id the primary key of the current models
	* @param model the model
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next models
	* @throws com.targeter.rulesengine.NoSuchmodelsException if a models with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.targeter.rulesengine.model.models[] findBymodel_PrevAndNext(
		long _id, java.lang.String model,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			com.targeter.rulesengine.NoSuchmodelsException;

	/**
	* Returns all the modelses.
	*
	* @return the modelses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.models> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the modelses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of modelses
	* @param end the upper bound of the range of modelses (not inclusive)
	* @return the range of modelses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.models> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the modelses.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of modelses
	* @param end the upper bound of the range of modelses (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of modelses
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.targeter.rulesengine.model.models> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the modelses where model = &#63; from the database.
	*
	* @param model the model
	* @throws SystemException if a system exception occurred
	*/
	public void removeBymodel(java.lang.String model)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the modelses from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of modelses where model = &#63;.
	*
	* @param model the model
	* @return the number of matching modelses
	* @throws SystemException if a system exception occurred
	*/
	public int countBymodel(java.lang.String model)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of modelses.
	*
	* @return the number of modelses
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}